
<%@ page import="org.tailor.Design" %>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="layout" content="main" />
  <g:set var="entityName" value="${message(code: 'design.label', default: 'Design')}" />
  <title><g:message code="default.list.label" args="[entityName]" /></title>
</head>
<body>
  <div class="nav">
    <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
    <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
  </div>
  <div class="body">
    <h1><g:message code="default.list.label" args="[entityName]" /></h1>
    <g:if test="${flash.message}">
      <div class="message">${flash.message}</div>
    </g:if>
    <div class="list">
      <table>
        <thead>
          <tr>

        <g:sortableColumn property="designName" title="${message(code: 'design.designName.label', default: 'Design Name')}" />

        <g:sortableColumn property="url" title="${message(code: 'design.url.label', default: 'Url')}" />

        <g:sortableColumn property="price" title="${message(code: 'design.price.label', default: 'Price')}" />

        <g:sortableColumn property="style" title="${message(code: 'design.style.label', default: 'Style')}" />

        <g:sortableColumn property="dateCreated" title="${message(code: 'design.dateCreated.label', default: 'Date Created')}" />


        </tr>
        </thead>
        <tbody>
        <g:each in="${designInstanceList}" status="i" var="designInstance">
          <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
            <td><g:link action="show" id="${designInstance.id}">${fieldValue(bean: designInstance, field: "designName")}</g:link></td>

          <td style="text-align: center">
            <img  height="100px" width='100px' 
                  src="../${fieldValue(bean: designInstance, field: "url")}" 
                  alt='${fieldValue(bean: designInstance, field: "url")}'
                  /> 
          </td>        

          <td>${fieldValue(bean: designInstance, field: "price")}</td>

          <td>${fieldValue(bean: designInstance, field: "style")}</td>
           <td><g:formatDate date="${designInstance.dateCreated}"  format= "MMM/dd/yyyy HH:MM:SS"/></td>

          </tr>
        </g:each>
        </tbody>
      </table>
    </div>
    <div class="paginateButtons">
      <g:paginate total="${designInstanceTotal}" />
    </div>
  </div>
</body>
</html>
